package com.itqf.xiaomi.controller;

import com.itqf.xiaomi.service.ResouceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * projectName: springboot_part
 *
 * @author: 赵伟风
 * time: 2021/9/26 16:41
 * description: 轮播图对应的controller
 */

@RestController
@CrossOrigin("*")
@RequestMapping("resources")
public class ResourceController {

    @Autowired
    private ResouceService resouceService;

    /**
     * 返回轮播图数据
     * @return
     */
    @PostMapping("carousel")
    public Object carousel(){

        Object r = resouceService.findAll();

        return r;
    }


}
